<template>
  <view class="main">
    <view class="inputCard">
      <view class="inputBox" style="border-bottom: 1px solid #f5f5f5">
        <view class="title">账户名</view>
        <up-input placeholder="" border="none" v-model="formData.name"></up-input>
      </view>
      <view class="inputBox">
        <view class="title">登录账号</view>
        <up-input placeholder="请输入商品名称" border="none" v-model="formData.age"></up-input>
      </view>
    </view>
    <view class="inputCard">
      <view class="inputBox">
        <view class="title">子账号权限</view>
      </view>
      <view class="inputBox">
        <view class="title">下单</view>
        <u-switch v-model="formData.isDefault" activeColor="#2ccf97" activeValue="1" inactiveValue="0"></u-switch>
      </view>
      <view class="inputBox">
        <view class="title" style="padding-left: 30rpx">可见商品价格</view>
        <u-switch v-model="formData.isDefault" activeColor="#2ccf97" activeValue="1" inactiveValue="0"></u-switch>
      </view>
      <view class="inputBox">
        <view class="title">下单和结算</view>
        <u-switch v-model="formData.isDefault" activeColor="#2ccf97" activeValue="1" inactiveValue="0"></u-switch>
      </view>
    </view>
    <view class="inputCard">
      <view class="inputBox" style="border-bottom: 1px solid #f5f5f5">
        <view class="title">可管理用户</view>
      </view>
      <view class="radioBox">
        <radio-group @change="radioChange" style="width: 100%">
          <label>
            <view class="inputBox">
              <view class="title">测试店铺</view>
              <radio value="1" :checked="'1' === formData.payType" color="#2ccf97" />
            </view>
          </label>
          <label>
            <view class="inputBox">
              <view class="title">测试店铺</view>
              <radio value="2" :checked="'2' === formData.payType" color="#2ccf97" />
            </view>
          </label>
          <label>
            <view class="inputBox">
              <view class="title">测试店铺</view>
              <radio value="3" :checked="'3' === formData.payType" color="#2ccf97" />
            </view>
          </label>
        </radio-group>
      </view>
    </view>
    <view class="bottomBox">
      <u-button @click="submit" text="确认添加" shape="circle" color="linear-gradient(90deg, #69E07D 0%, #2ED19A 33%, #1BBD7E 100%)"></u-button>
    </view>
  </view>
</template>

<script setup lang="ts">
import { ref } from "vue";
const formData = ref({
  name: "",
  age: "",
  isDefault: "",
  payType: "1",
});
const radioChange = () => {};
const submit = () => {};
</script>

<style lang="less" scoped>
.inputCard {
  background: #ffffff;
  margin-top: 20rpx;
  padding: 32rpx;
  border-radius: 20rpx;
  .inputBox {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20rpx;
    padding-bottom: 34rpx;
    border-bottom: 1px solid #f5f5f5;
    padding-top: 24rpx;
    .title {
      width: 180rpx;
      font-size: 28rpx;
      color: #1e1e1e;
      line-height: 48rpx;
    }
    &:first-child {
      padding-top: 0;
    }
    &:last-child {
      padding-bottom: 0rpx;
      border-bottom: none;
    }
  }
  .radioBox {
    .inputBox {
      margin-bottom: 20rpx;
    }
  }
}
</style>
